package org.grayrabbit.cms.component;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;


public class Rollannounce extends AbstractComponent{

	public  Map<String, String> loadparameterMap(String component,String[] ps){
//		id@-@title@-@catIds@-
//		id@撒@title@我@catIds@4028839d301f966c01301fb01de70001,4028839d301fc46101301fc6f6d80004
//		String[] keys={"id","title","catIds"};
		 
		
		Map<String,String> map = new HashMap<String,String>();
	 
		for(int i=0;i<ps.length;i=i+2){ 
			String exp="";
			if("id".equalsIgnoreCase(ps[i])){
				if(StringUtils.isNotBlank(ps[i+1])) 
					exp="id='"+ps[i+1]+"'";			 
				map.put("id", exp);
			}else if("title".equalsIgnoreCase(ps[i])){
				if(StringUtils.isNotBlank(ps[i+1]))
					exp="title='"+ps[i+1]+"'";
				map.put("title", exp);
			}else if("catIds".equalsIgnoreCase(ps[i])){
				if(StringUtils.isNotBlank(ps[i+1])) 
					exp="catIds="+ArrayToString(ps[i+1].split(","), true);
				map.put("catIds", exp);
			}
		} 
		return map;
	}
 
}
